<%@ page language="java" contentType="text/html;" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../inc.jsp"></jsp:include>
<title>订单查询-查看</title>
<style type="text/css">
 .yellow_btn{
	border: none;
	border-radius: 5px;
	background-color: #FF6600;
	color: #FFFFFF;
	padding: 5px 20px;
	height: 25px;
	margin:3px 10px;
	font-weight: bold;
	text-decoration:none;
}	
.list_wrap{
    list-style: none;
    margin-top: 10px;
}
.list_wrap li{
    padding: 5px;
}
.table_b{
    border: 1px dotted #ddd;
    margin-bottom:5px;
    margin-top:-10px;
    margin-left:20px;
    border-left:1px dotted #95b8e7;
    border-top:1px dotted #95b8e7;
}
.table_b thead{
    color:#3989c8;
}
.table_b td{
	border:1px dotted #ddd;
	padding:5px;
	text-align: center;
}
.font_money {
	color:#FF6600;
	font-size: 20px;
}
</style>
<script type="text/javascript">
$(function(){
	progressLoad();
	$.ajax({
		type:'get',
		url:'${ctx}/order/orderDetail/${orderNumber}',
		dataType:'json',
		success:function(data){
			progressClose();
			if(data.success){
				//alert(data.obj.toStartAirport);
				initPage(data.obj);
			}
			else{
				layer.alert(data.msg);
			}
		},
		error:function(msg){
			progressClose();
			layer.alert("请检查您的网络连接，然后重试！");
		}
	}); 
});
var purchQuantity = 0;
//加载航班信息表格
function initPage(b){
	$("#itineraryName").text(b.toStartAirport+"-"+b.toEndAirport);
	$("#periodDesc").text(b.travelDays);
	$("#payPrice").html(b.payPrice);
	//$("#orderStatus").html(b.orderStatus);
	$("#orderStatus").html(CommonConverter.toOrderBizStatusStr(b.orderStatus));
	$("#unitPrice").html(b.unitPrice);
	$("#purchQuantity").html(b.purchQuantity);
	$("#payEndTime").html(b.payEndTime);
	$("#ticketEndTime").html(b.ticketEndTime);
	purchQuantity = b.purchQuantity;
	
	for(var n in b.flights){
		var f = b.flights[n];
		var seatClass = "";
		if(f.cabin == 'F'){//头等舱  经济舱 商务车  bootTable
			seatClass = "头等舱";
		}else if(f.cabin == 'E'){
			seatClass = "经济舱";
		}else if(f.cabin == 'S'){
			seatClass = "bootTable";
		}else if(f.cabin == 'C'){
			seatClass = "商务车";
		}
		var i = n-0+1;
		$("#tbl_flights").append("<tr class='table_body'>"
			+"<td>"+i+"</td>"
			+"<td>"+f.flightNumber+"</td>"
			+"<td>"+seatClass+"</td>"
			+"<td>"+f.departureCity+"("+f.departureCode+")"+"-"+f.arrivalCity+"("+f.arrivalCode+")"+"</td>"
			+"<td>"+f.departureDateStr+"</td>"
			+"<td>"+f.departureTime+"</td>"
			+"<td>"+f.arrivalTime + (f.intervalDay>=0?("(+"+f.intervalDay+")"):"")+"</td>"
			+"</tr>");
	}
};
</script>
</head>
<body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center'" >
			<div class="easyui-panel" title="产品信息" style="height: auto;">
				<ul class="list_wrap">
					<li>航线： <span id="itineraryName"></span>&nbsp;&nbsp;&nbsp;&nbsp;  往返间隔天数：<span id="periodDesc"></span></li>
					<li>航班信息：</li>
				</ul>
				<table cellpadding="0" cellspacing="0" width="95%" class="table_b" id="tbl_flights">
					<thead>
					<tr>
						<td width="5%">序号</td>
						<td width="10%">航班号</td>
						<td width="10%">舱位</td>
						<td width="45%">行程</td>
						<td width="10%">起飞日期</td>
						<td width="10%">出发时刻</td>
						<td>到达时刻</td>
					</tr>
					</thead>
				</table><br/>
			</div>
			<div class="easyui-panel" title="价格及支付" style="height: auto;">
				<br/><br/>
				<ul class="list_wrap">
					<li>票价：成人 <span id="unitPrice"></span>元/人 </li>
					<li>采购数量： <span id="purchQuantity"></span></li>
				</ul>
				<table cellpadding="0" width="90%" cellspacing="0" class="table_b">
					<thead>
					<tr>
						<td width="10%">支付金额</td>
						<td width="10%">支付截止时间</td>
						<td width="10%">类型</td>
						<td width="10%">状态</td>
					</tr>
					</thead>
					<tr class="table_body">
						<td><span id="payPrice"></span></td>
						<td><span id="payEndTime"></span></td>
						<td>票款</td>
						<td><span id="orderStatus"></span></td>
					</tr>
				</table><br/>
			</div>

			<div class="easyui-panel" title="出票信息" style="height: auto;" >
				<br/>&nbsp;&nbsp;&nbsp;&nbsp;最晚出票时间：<span id="ticketEndTime"></span>
				<br/>
				<br/>
			</div>
 		</div>
 		
	</div>

 
</body>
</html>